import createAxios from './axios'

const PROXY_PATH = '/api'

// --------------------------请求路径--------------------------
// 1.获取所有的本楼栋房间信息
const ROOMS_INFO_PATH = '/hou/getBuildOne'

// 2.根据房间号获取人员信息
const MEMBER_PATH = '/hou/roomMembers'

// --------------------------方法：--------------------------

// 宿舍管理模块
// 1.宿舍信息
// 1.1 获取所有的本楼栋房间信息
export const getAllRoomInfo = ({ currentPage, pageSize }) =>
	createAxios('get', PROXY_PATH + ROOMS_INFO_PATH, { currentPage, pageSize })
// 1.2 根据房间号获取人员信息
export const getMemberInfo = ({ roomId }) => createAxios('get', PROXY_PATH + MEMBER_PATH, { roomId })

//1.3 房间号查询房间信息
export const getBuildOneRoom = ({ dorNumber }) =>
	createAxios('get', PROXY_PATH + '/hou/getBuildOneRoom', {
		dorNumber,
	})

// 2.换房申请
// 2.1 查看学生换房申请 (查出所有未审核的)
export const queryExchangeInfoNo = ({ currentPage, status, pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/queryExchangeInfoNo', { currentPage, status, pageSize })
// 2.2  按照学号进行换房信息申请的搜索
export const queryExchangeInfoStu = ({ stuId, currentPage }) =>
	createAxios('get', PROXY_PATH + 'hou/queryExchangeInfoStu', { stuId, currentPage })
// 2.3 宿管同意
export const agreeExchangeInfo = ({ changeId }) =>
	createAxios('post', PROXY_PATH + '/hou/agreeExchangeInfo', { changeId })
// // 2.4 宿管查看换房申请记录（查出所有已审核通过的或被拒绝的）
// export const getChangeRoomApplyLog = (data) => createAxios('get', PROXY_PATH + 'hou/	  ', data)
// 2.5 宿管删除单个换房申请记录，
export const deleteExcahngeInfoByHou = ({ changeId }) =>
	createAxios('get', PROXY_PATH + 'hou/deleteExcahngeInfoByHou', { changeId })
// 2.6 宿管拒绝换房申请
export const downExchangeInfo = ({ changeId }) =>
	createAxios('post', PROXY_PATH + '/hou/downExchangeInfo', { changeId })
// 2.7 宿管查看某栋所有的换房申请
export const queryExchangeInfoAll = ({ currentPage,pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/queryExchangeInfoAll', { currentPage,pageSize })

// 3.公共设施管理
// 3.1 查看所有公共设施
export const getAllPublicEquiment = ({ currentPage,pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/getPublicByHou', { currentPage,pageSize})
// 3.2  宿管新增公共设施
export const addPublicEquiment = ({ publicName,publicCount }) =>
	createAxios('get', PROXY_PATH + '/hou/addPublicByHou', { publicName,publicCount })
// 3.3 宿管删除某个设施
export const delOneEquiment = ({ publicId }) => createAxios('post', PROXY_PATH + '/hou/deletePublicByHou', { publicId })
// 3.4 宿管更新某个设施
export const updateEquiment = ({ publicId, publicName, publicCount }) =>
	createAxios('post', PROXY_PATH + '/hou/updatePublicByHou', { publicId, publicName, publicCount })
// 3.5 搜索某一名称的公共设施情况
export const getPublicOneName = ({ currentPage, publicName }) =>
	createAxios('get', PROXY_PATH + '/hou/getPublicOneName', { currentPage, publicName })

// 学生管理模块
// 1.学生信息管理
// 1.1 查看所有学生信息
export const getStu = ({ currentPage, buildId, pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/getStu', { currentPage, buildId, pageSize })


// 3.学生假期去向管理
// 3.1  宿管查看某楼栋所有的学生假期情况
export const getAllStuHolInfo = ({ currentPage, buildId }) =>
	createAxios('get', PROXY_PATH + '/hou/getAllHolBuild', {
		currentPage,
		buildId,
	})
// 3.2 宿管查看本楼栋某寝室的假期情况
export const getRoomHolInfo = ({ buildId, dorNumber }) =>
	createAxios('get', PROXY_PATH + '/hou/getHolBuildRoom', {
		buildId,
		dorNumber,
	})
// 3.3 宿管查看某个学生的假期情况
export const getHolOneStu = ({ stuId, stuName }) =>
	createAxios('get', PROXY_PATH + '/hou/getHolOneStu', { stuId, stuName })
// 3.4宿管获取某楼栋假期留校申请中的数据
export const getHolApplying = ({ currentPage, pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/getHolApplying', { currentPage, pageSize })

// 3.5宿管查看某楼栋在校学生信息
export const getHolBuildOn = ({ currentPage, pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/getHolBuildOn', { currentPage, pageSize })
// 3.6宿管查看某楼栋离校学生信息
export const getHolBuildLeave = ({ currentPage, pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/getHolBuildLeave', { currentPage, pageSize })
// 3.7 宿管通过假期留校申请
export const passHolApplyBegin = ({ holId }) => createAxios('get', PROXY_PATH + '/hou/passHolApplyBegin', { holId })

// 学生事务管理模块
// 1.报修管理
// 1.1 获取所有报修信息
export const getAllRepairInfo = ({ currentPage, pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/getRepairByHou', { currentPage, pageSize })
// 1.2  宿管获取某楼栋某寝室的报修信息
export const getRepairInfoByDorNum = ({ currentPage, dorNumber, pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/getRepairBuildRoom', { currentPage, dorNumber, pageSize })
// 1.3 处理报修
export const planRepair = ({ repairId }) => createAxios('post', PROXY_PATH + '/hou/planRepair', { repairId })
//
// 2.留言管理
// 2.1宿管查看某楼栋的留言信息
export const queryAllMessage = ({ currentPage, pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/queryAllMessage', { currentPage, pageSize })
// 2.2宿管查看详细留言信息
export const queryMessageDetail = ({ msgId }) => createAxios('get', PROXY_PATH + '/hou/queryMessageDetail', { msgId })
// 2.3 宿管删除某学生的留言信息
export const deleteMessageInfoByHou = ({ msgId }) =>
	createAxios('get', PROXY_PATH + '/hou/deleteMessageInfoByHou', { msgId })
// 2.4 宿管查看某学生的留言信息(大概,前20字符)
export const queryOneStuMessage = ({ stuId, currentPage }) =>
	createAxios('get', PROXY_PATH + '/hou/queryOneStuMessage', { stuId, currentPage })

// 3.卫生检查管理
// 3.1 宿管查询某楼栋的卫生信息
export const getHygOne = ({ currentPage, pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/getHygOne', { currentPage, pageSize })
// 3.2 添加卫生信息
export const addHygByHou = (data) => createAxios('get', PROXY_PATH + '/hou/addHygByHou', data)
// 3.3 修改卫生信息
export const updateHygByHou = ({ dorNumber, checkSore, hygDes, hygId }) =>
	createAxios('post', PROXY_PATH + '/hou/updateHygByHou', { dorNumber, checkSore, hygDes, hygId })
// 3.4 删除卫生信息
export const deleteHygByHou = ({ hygId }) => createAxios('post', PROXY_PATH + '/hou/deleteHygByHou', { hygId })

// 个人中心模块
// 1.宿管修改密码
export const modfiyPwd = (data) => createAxios('post', PROXY_PATH + '', data)
// 2.宿管完善个人信息
export const changeHouInfo = (data) => createAxios('post', PROXY_PATH + '/hou/changeHouInfo', data)

// 公告栏管理模块
// 1.宿管查询某楼栋的公告
export const getNoticeByHou = ({ currentPage, pageSize }) =>
	createAxios('get', PROXY_PATH + '/hou/getNoticeByHou', { currentPage, pageSize })
// 2.宿管发布公告
export const addNoticeByHou = ({ noticeContent }) =>
	createAxios('get', PROXY_PATH + '/hou/addNoticeByHou', { noticeContent })
// 3.宿管修改公告
export const updateNoticeByHou = ({ noticeId, noticeContent }) =>
	createAxios('post', PROXY_PATH + '/hou/updateNoticeByHou', {noticeId, noticeContent})
// 4.宿管删除公告
export const deleteNoticeByHou = ({ noticeId }) =>
	createAxios('post', PROXY_PATH + '/hou/deleteNoticeByHou', { noticeId })
